﻿@using ERP.Workflow.Designer.BlazorUI
@using ERP.Workflow.Designer.BlazorUI.Domain
 
@implements  ERP.Abp.AntDesignUI.IReuseTabsPage


@page "/aaaaa/workflow/designer/{id}"
@inject   IDefinitionAppService?  _definitionAppService

      
<DiagramPanel   @ref="_DiagramPanel">

</DiagramPanel>

@code {
    [Parameter] public string Id{ get; set; }

    DefinitionSaveDto DefinitionDto = new DefinitionSaveDto();

    DiagramPanel _DiagramPanel;
    protected override async void OnInitialized()
    {
      

        var b = await     _definitionAppService!.IsExistAsync(Guid.Parse(Id));
        var id = Guid.Parse(Id);
        if (b)
        {
            DefinitionDto=  await   _definitionAppService.FindDetailAsync(id);
        }
        else
        {
            DefinitionDto.Definition = new DefinitionDto { Name="LONG", Id=id, Version="1.0" };
        }
      
        base.OnInitialized();
    }
    public RenderFragment GetPageTitle()
    {
           return 
    @<span><AntDesign.Icon Type = "highlight" />流程设计</span>;
    }

}
